/**
 * 深度比较两个对象属性和属性值是否完全相等的方法
 * @param {用于比较的对象1} obj1 
 * @param {用于比较的对象2} obj2 
 * @returns 
 */
let deepCompare = function (obj1, obj2) {
    console.log(obj1, obj2)
    if (obj1 === obj2) {
        return true
    } else if (typeof obj1 == 'object' && typeof obj2 == 'object') {
        const keys1 = Object.keys(obj1)
        const keys2 = Object.keys(obj2)
        if (keys1.length !== keys2.length) {
            return false
        }
        for (let key of keys1) {
            if (!keys2.includes(key) || !deepCompare(obj1[key], obj2[key])) {
                return false
            }
        }
        return true
    } else {
        return false
    }
}

export default {
    deepCompare
}